home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / tools / make / tcmak / addendum next >
Encoding:
Text File  |  1988-07-19  |  3.6 KB  |  81 lines

  1.  
  2. This program, originally written for compilation in and use with
  3. Microsoft's C compiler, version 5.0, has been revised and ported to
  4. TurboC -- but NOT for compilation in MSC 4.0.  It can be used with
  5. MSC, version 4.0 or 5, as well, if the defaults are overriden in an
  6. appropriate makemak.cfg file tailored to the MSC environment.  This,
  7. however, will be imperfect since each compiler command line should end
  8. with a semicolon for 'msc.exe.'  The reason for compiling in TC,
  9. rather than MSC 4.0 (which I also have), is that the program relies on
  10. the findfirst()/findnext() ANSI-C calls.  TC has them; MSC 4.0 does
  11. not.
  12.  
  13. ADDENDA TO INSTRUCTIONS:
  14.  
  15. 1.    The command to generate a makefile named "makefile", which
  16. specifies a target file to be made named "target.exe" is:
  17.  
  18.             makemake target.exe > makefile
  19.  
  20. The name target.exe (or whatever else you specify) will be used within
  21. the generated makefile.  And, without redirection, the makefile to be
  22. generated will be displayed on the screen, but no file will be created.
  23.  
  24. To use this makefile, you must invoke TC's somewhat brain-damaged 'make'
  25. capability -- which is not quite as bad as Microsoft's! -- with the
  26. command:
  27.  
  28.             make target.exe
  29.             
  30. 2.    Note that the makemak.cfg file can be located in any directory
  31. specified by the PATH environment variable.  The program will search for
  32. it along the PATH.
  33.  
  34. 3.    Note that the makemak.cfg file contains full paths to the
  35. library and include files, consistent with my file structure.  Vary
  36. these as appropriate.  The key point is that all of the library files
  37. required by TC's tlink are specified:  the c0x.obj file that must be 
  38. linked with your .obj files, and the emu.lib mathx.lib and cx.lib
  39. libraries that must be linked in.  Note also that the small model is
  40. specified in makemak.cfg.  This can (and should) be varied as
  41. appropriate.
  42.         
  43.  
  44. CHANGES:
  45.  
  46. The excessive link command line problem is solved.  The program
  47. automatically generates a file named "linkfile" when run, which file
  48. contains the names of the .obj files to be linked together.  The program
  49. then looks at the length of this file.  If it is 50 bytes (characters)
  50. or more in length, the link instruction generated in the makefile is:
  51.  
  52.     $(LINK) $(L_OPTS) @linkfile, $(TARGET), $(LMAP), $(LIBS)
  53.  
  54. i.e., it will look to the linkfile for the list of .obj files to be
  55. linked together.  If it is 49 characters or less in length, the link
  56. instruction generated in the makefile is:
  57.  
  58.     $(LINK) $(L_OPTS) $(OBJS), $(TARGET), $(LMAP), $(LIBS)
  59.  
  60. i.e., the list of .obj files will be expanded to the link command line.
  61.  
  62. 50 characters was chosen as the boundary because tlink seemingly can
  63. take up to 128 characters of arguments, and some 60 of these are
  64. consumed with the overhead of the files that must be linked with any
  65. TurboC-generated .objs (if reasonably full paths are specified to them).
  66.  
  67. However, to hedge the bet, in case the 50 character boundary is wrong,
  68. the alternate link instruction is generated in the makefile in each
  69. case, preceeded by a comment indicator (#).  (Some DOS 'make' commands
  70. will properly ignore a commented line; others will not, but will
  71. continue after an error indication.  If it is annoying, simply delete
  72. the unnecessary line later.)  So, if the link line bombs because it is
  73. too long, just comment out the existing link instruction and uncomment
  74. the alternate.  This takes care of two possibilities:  (a) where you
  75. have shorter paths to the libraries, and can include more .obj files
  76. on the tlink (or Microsoft link) command line; and (b) where you have
  77. longer paths to the libraries, and cannot take 49 characters of .obj
  78. files on the linker command line.
  79.  
  80.                 mike2@lcuxa
  81.